#ifndef SELECTOS_H
#define SELECTOS_H

#include <QWidget>
#include <QAbstractNativeEventFilter>
#include <QString>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QUrl>
#include <QFile>
#include <QDebug>
#include <QMessageBox>
#include <QProgressBar>
#include <QLineEdit>
namespace Ui {
    class SelectOS;
}

class QMenu;
//static QProgressBar* progressBar;

class SelectOS : public QWidget
{
    Q_OBJECT

public:
    explicit SelectOS(QWidget* parent = 0);
    ~SelectOS();
    
    

private slots:
    void on_pushButton_download_clicked();
    void on_pushButton_back_clicked();
    void readContent();
    void replyFinished(QNetworkReply*);
    void replyOSListFinished(QNetworkReply*);
    void loadError(QNetworkReply::NetworkError);
    void loadProgress(qint64 bytesSent, qint64 bytesTotal);
    void loadProgressValue(qint64 bytesSent, qint64 bytesTotal);
    void downloadFile(QString name, QUrl url);
    void downloadOSListFile(QString name, QUrl url);
    
private:
    Ui::SelectOS* ui;
    SelectOS *selectOS;
    void init_controls();
    void initOSList();
    QLineEdit* path;
    QProgressBar* progressBar;
    QNetworkReply* reply;
    QFile* file;
    //QNetworkAccessManager* manager;
    QNetworkAccessManager* accessManager;
    QLabel  *label_currentByte_value;
    QLabel  *label_countSize_value;
    QLabel* label_currentByte;
    QLabel* label_countSize;
};
#endif // FORMDEFAULTSTYLE_H
